#include<stdio.h>
#include<string.h>
int main()
{
	int i;
	char s[100]=" ";
	gets(s);
	for(i=0;i<strlen(s);i++)
	{
		if(s[i]!=' '&&s[i]!=','&&s[i]!='.'&&s[i]!='!'&&s[i]!='?')
		     putchar(s[i]);
	    else if(s[i+1]!=' '&&s[i+1]!=','&&s[i+1]!='.'&&s[i+1]!='!'&&s[i+1]!='?')
	      printf("\n");
	}
	return 0;
 } 
